home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
SWAG
/
SWAGA_C
/
COMM.SWG
/
0039_Accessing The Phone.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-01-27
|
1KB
|
45 lines
{
From: MIGUEL MARTINEZ
Subj: Accessing the phone
---------------------------------------------------------------------------
▒ I am a novice programmer and I am writing an address book type program
▒ in TP 6.0. How can I send the phone a number to be dialed? Thanx.
Try this routines:
}
USES CRT;
Procedure DialNumber(Number:String);
Var ComPort:Text;
ComName:String;
Begin
ComName:='COM2'; (* Assuming your modem is located there *)
Assign(ComPort,ComName);
ReWrite(ComPort);
Writeln(ComPort,'ATDT'+Number);
Close(ComPort);
End;
Procedure Hangup;
Var ComPort:Text;
ComName:String;
Begin
ComName:='COM2'; (* Assuming your modem is located there *)
Assign(ComPort,ComName);
ReWrite(ComPort);
Writeln(ComPort,'ATH0M1');
Close(ComPort);
End;
{An example of how to use this routines, is this fragment of code:}
BEGIN
DialNumber('345554323');
Repeat Until Keypressed;
Hangup;
END.
If you don't hang up, guess... You'll get a funny noise if you don't
connect. :)